package com.zs.members.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author 张硕
 * @since 2021-07-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("coupon_history")
@ApiModel(value = "CouponHistory对象", description = "")
public class CouponHistory extends Model<CouponHistory> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "优惠券记录id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "优惠券id")
    @TableField("coupon_id")
    private Long couponId;

    @ApiModelProperty(value = "用户id")
    @TableField("member_id")
    private Long memberId;


    //获取类型：0->后台赠送；1->主动获取
    @ApiModelProperty(value = "获取类型：0->后台赠送；1->主动获取")
    @TableField("get_type")
    private Integer getType;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private String createTime;

    //使用状态：0->已使用；1->未使用；2->已过期
    @ApiModelProperty(value = "使用状态：0->未使用；1->已使用；2->已过期")
    @TableField("use_status")
    private Integer useStatus;

    //使用时间
    @ApiModelProperty(value = "使用时间")
    @TableField("use_time")
    private String useTime;


    //订单编号
    @ApiModelProperty(value = "订单编号")
    @TableField("order_sn")
    private String orderSn;

    //用户账号名
    @ApiModelProperty(value = "会员账号")
    @TableField(exist = false)
    private String username;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
